<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld"%>
<%@taglib prefix="mu" uri="/WEB-INF/tld/mallutil.tld"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<style> 
.promo-popup{padding:10px;*padding:10px 0 10px 8px; color:#666;line-height:1.4em; }
.promo-popup h2,.promo-popup h3{font-size:15px;color:#d12e6f; margin-bottom:.8em;}
.promo-popup h3{color:#666;}
.promo-popup p{margin:.5em 0;}
.promo-popup .d-line{background:url(/images/link_dote.gif) repeat-x scroll 0 50%; padding:1px 0;}
.promo-popup ol,.promo-popup ul{margin-bottom:1em;margin-left:2em;}
.promo-popup li{list-style:decimal;}
</style>
<script type="text/javascript" charset="UTF-8" src="/genJS/yaodian_zipcode.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.cascade.ext.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.cascade.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.templating.js"></script>
<!-- content start -->
<div class="content mb-od-dtl">
<c-rt:if test="${serviceOrder.memberId==mu:memberId()}">



${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', serviceOrder.orderId)) }


<%--出货查询 --%>
<c-rt:set var="logisticComp" value="${null }"/>
<c-rt:set var="logisticNum" value="${null }"/>
<c-rt:set var="logisticUrl" value="${null }"/>
<c-rt:set var="logisticDisplay" value="Y"/>
<c-rt:forEach items="${serviceOrderProducts}" var="sop" varStatus="opStatus">
<c-rt:if test="${empty logisticNum}">
    <c-rt:if test="${(!empty sop.logisticCompany) && (sop.logisticCompany != ' ')}">    	
		<c-rt:set scope="request" var="logisticNum" value="${sop.logisticRefNum } " />
		${pu:reqSet('lc', pu:get('com.yaodian100.crm.workorder.entity.LogisticProvider', sop.logisticCompany)) }
	
 		<c-rt:if test="${!empty lc}">
  			<c-rt:set scope="request" var="logisticComp" value="${lc.name} " />
  			<c-rt:set scope="request" var="logisticUrl" value="${lc.searchUrl} " />
  		</c-rt:if>
  		<c-rt:if test="${empty lc}">
  			<c-rt:set scope="request" var="logisticComp" value="${sop.logisticCompany}" />
  			<c-rt:set var="logisticDisplay" value="N"/>
  		</c-rt:if>  		
	</c-rt:if>
    </c-rt:if>
</c-rt:forEach>
<c-rt:if test="${empty logisticComp || logisticComp==''|| logisticComp== 'null'}">  
	<c-rt:if test="${!empty sop.logisticCompany && logisticComp!=''}">
	  	<c-rt:set var="logisticComp" value="${op.logisticCompany} " />
	  </c-rt:if>   

  <c-rt:set var="logisticDisplay" value="N"/>
</c-rt:if>

<script>
$(function(){
	$('#current_location').html(' > 我要换货');
});
function openLogisticInfo(){
	
	var html='<div class="ui-dialog-content ui-widget-content" id="dialog" style="height: 200px; min-height: 110px; width: auto;">'+
		 ' <p>1. 在与耀点100配合的物流公司网站查询页面中，您输入所要查询的商品快递单号，便可得知商品最新配送进度。</p><br>'+
		  '<p>2. 因配送作业关系，商品发货1天后，您可查询到出货进度。</p><br>'+
		  '<p>3. 如您查询出货进度时遇到问题，请致电客服：4001-168-100。</p><br>'+
		  '<div align="center"> <span style="text-align: center;">'+
		  "<a class=\"btn-mid\" href=\"${logisticUrl}\" target=\"_blank\" onclick=\"goLogistic();return false;\">前往查询</a>"+
		  '<a class="btn-mid" href="javascript:;" onclick="closeDialog();return false;">关闭</a></span> </div>'+
		'</div>';
	openDialog('快递单号查询', html, 430, 250);
}
function goLogistic(){
	window.open("${logisticUrl}");
	closeDialog();
}
</script>
	<script>
$(function(){
	<c-rt:if test="${empty param.skipDialog}">
	<c-rt:if test="${serviceOrder.orderSt=='10'}">
	content='<strong>换货申请中，请于收到商品后15天內将换货商品寄出。</strong>';
	</c-rt:if>
	<c-rt:if test="${serviceOrder.orderSt=='20'}">
    content='<strong>换货商品已发货。</strong>';
    </c-rt:if>   
    <c-rt:if test="${serviceOrder.orderSt=='30' }">
    content='<strong>换货商品不符合换货标准，等待客服人员联系。</strong>';
    </c-rt:if>
    <c-rt:if test="${serviceOrder.orderSt=='40'}">
    content='<strong>换货转退货成功，已完成退款。</strong>';
    </c-rt:if>
    <c-rt:if test="${serviceOrder.orderSt=='50'}">
    content='<strong>换货商品未于期限内寄出，换货申请失败。</strong>';
    </c-rt:if>
    <c-rt:if test="${serviceOrder.orderSt=='60'}">
    content='<strong>换货商品未于期限内寄出，换货申请失败，商品已退回。</strong>';
    </c-rt:if>
    <c-rt:if test="${serviceOrder.orderSt=='70'}">
    content='<strong>换货商品不符合换货标准，无法进行换货。</strong>';
    </c-rt:if>
    <c-rt:if test="${serviceOrder.orderSt=='80'}">
    content='<strong>您已于<fmt-rt:formatDate value="${serviceOrder.modifyDate}" pattern="yyyy-MM-dd HH:mm"/>取消换货</strong>';
    </c-rt:if>
    <c-rt:if test="${serviceOrder.orderSt=='90'}">
    content='<strong>换货商品已送达，换货完成。</strong>';
    </c-rt:if>
    var anchor=location.hash;
    if(anchor && anchor!='#receiverInfo')
	confirmDialog('换货申请', content, doNotThing, 480,180 );
	</c-rt:if>
	
});
function doNotThing(){}
</script>

	<!-- 我的訂單 --> 
      <p align="center"><img src="/images/step_change.gif" alt="换货流程教学图" style="margin-bottom:7px;" /></p> 
      <p class="a-function"><a href="/help/8_policy.html">换货政策说明</a> | <a href="/help/8_exchange.html">换货流程说明</a>｜<a href="<c-rt:url value="/member/serviceOrder/changeProductPrint.do?serviceOrderId=${serviceOrder.serviceId }"/>" class="a-print">打印本页</a></p> 
      <h2>换货明细</h2> 
       <h3>换货申请状态</h3> 
     <div class="d-show"> 
	    
	    <c-rt:if test="${serviceOrder.orderSt=='10'}">
	    <strong>您的换货申請已經提交！<br /> 
           请于<span class="txt-rd"><fmt-rt:formatDate value="${pu:addDays(order.orderProduct[0].logisticFinalDt, 15)}" pattern="yyyy-MM-dd"/></span>前将换货商品依以下说明寄回。</strong><span class="txt-s">（如遇假日，可顺延寄出）</span>
        <br/>
        <table border="0" class="tb-3">
           <tr>
             <th valign="top">寄回地址</th>             
             <td><p class="txt-rd">${serviceOrder.returnAddr}  ︱邮编：${serviceOrder.returnZip} <br />
               ${serviceOrder.returnContact} 收   (联络电话：${serviceOrder.returnPhone})</p>
               <p>(建议您使用｢中国邮政-挂号包裹｣、 ｢星辰急便｣、｢宅急送｣或｢圆通｣等物流方式寄回。)</p></td>            
           </tr>
           <tr>
             <th valign="top">换货须知</th>

             <td><p><strong>换货商品注意事项：</strong></p>
               <ul class="li-w1">
                 <li>1.  商品及包装需保持耀点100出售时原状且配件齐全。</li>
                 <li>2.  请勿直接于原厂包装上黏贴纸张或书写文字，若原厂包装毁损将无法退换货。</li>
                 <li>3.  商品退回后，请务必保留寄货或收货员取件收据，以利您后续查询退回进度。</li>
               </ul>
               <p>&nbsp;</p>
               <p><strong>退回商品时，请备妥以下资料一并提供：</strong></p>
               <ul class="li-w1">
                 <li>1.  请附上发货单。</li>                 
                 <li>2.  打印此换货明细页，或以纸张注明以下信息：<br />
                   ．换货人姓名與帐户名<br />
                   ．订单编号<br />
                   ．换货商品與数量<br />
                   ．换货原因</li>
                 <li></li>
               </ul>
               <p><strong>因质量问题造成的换货，请您遵守以下指示，我们将为您报销运费：</strong></p>
               <ul class="li-w1">
                 <li>1.  选择｢中国邮政-挂号包裹｣、 ｢星辰急便｣、｢宅急送｣或｢圆通｣等物流方式寄回。</li>                 
                 <li>2.  请勿指定「特急件」或选择「航空」或「到付」等特殊配送方式寄回。</li>
                 <li>3.  请将运费发票或其他有效运费证明连同换货商品一并寄回。</li>
                 <li>4.  耀点100为您报销的费用，將退至｢我的耀点100 - 账户余额｣中。</li>
               </ul>
               <p>&nbsp;</p>
               <p><span class="txt-rd">*提醒：</span>请务必遵守以上指示，若违反以上说明之换货，耀点100将可能无法为您报销全数运费，
             为保障您的权益，如有任何疑问，请致电客服：4001-168-100。</p></td>
           </tr>
         </table>
         <p style="margin:.5em 0 1em;" class="txt-gy">（遵守以上换货须知，有助于顺利完成您的换货申请。）</p>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='20'}">
        <div class="step-payment-head">您的换货商品已经发货。</div>
       <c-rt:if test="${not empty logisticComp && logisticComp != ''}"> 
          <ul>
            <li class="w-1of2"><strong>．快递单号为：</strong><span class="txt-rd">${logisticNum }</span><c-rt:if test="${logisticDisplay=='Y'}"><a a href="javascript:;" onclick="openLogisticInfo();return false;" > &gt;&gt;查询商品发货进度</a></c-rt:if></li>
            <li class="w-1of1"><strong>．配送公司：</strong>${logisticComp}</li>
          </ul>
          </c-rt:if>       
        </c-rt:if> 
        <c-rt:if test="${serviceOrder.orderSt=='25'}">
        <p style="line-height: 2em;" class="txt-m"><strong>您的换货商品已经送达！请于<span class="txt-rd"><fmt-rt:formatDate value="${pu:addDays(serviceOrder.logisticFinalDt, 7) }" pattern="yyyy-MM-dd"/></span>前至您指定的门店取货。</strong></p>
        </c-rt:if>   
        <c-rt:if test="${serviceOrder.orderSt=='30' }">
        <strong>换货商品不符合换货标准，等待客服人员联系。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='40'}">
        <strong>换货转退货成功，已完成退款。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='50'}">
        <strong>换货商品未于期限内寄出，换货申请失败。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='60'}">
        <strong>换货商品未于期限内寄出，换货申请失败，商品已退回。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='70'}">
        <strong>换货商品不符合换货标准，无法进行换货。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='80'}">
        <strong>您已于<fmt-rt:formatDate value="${serviceOrder.modifyDate}" pattern="yyyy-MM-dd"/>取消换货</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='90'}">
        	<c-rt:if test="${serviceOrder.receiverTp=='30'}"><p style="line-height: 2em;" class="txt-m"><strong>您已于<span class="txt-rd"><fmt-rt:formatDate value="${serviceOrder.logisticSignDt}" pattern="yyyy-MM-dd"/></span>领取换货商品</strong></p></c-rt:if>
      		<c-rt:if test="${serviceOrder.receiverTp!='30'}"><strong>换货商品已送达，换货完成。</strong></c-rt:if>        
        </c-rt:if>
           
         
     </div> 
      <!-- 訂單資訊 --> 
      <h3>订单信息</h3> 
      <div class="d-show"> 
        <ul> 
          <li class="w-1of2"><strong>订单编号：</strong>${serviceOrder.orderId }</li> 
          <li class="w-1of2"><strong>订购时间：</strong><fmt-rt:formatDate pattern="yyyy/MM/dd HH:mm" value="${order.createDate }"/></li> 
          <li class="w-1of2"><strong style="padding-left:1.1em">收货人：</strong>${order.receiverName }</li> 
          <li class="w-1of2"><strong>支付方式：</strong>${pu:menuOption('Order.PaymentTp', serviceOrder.paymentTp).name }</li> 
        </ul> 
      </div> 
      <!-- 訂單資訊 --> 
      <!-- 換货資訊 --> 
      <h3>换货信息<span>填写换货单信息缺失，可能造成我们无法为您办理退货事宜。</span></h3> 
      <div class="d-show"> 
        <p style="margin:0 0 10px 1.25em;"><strong>換货商品数量与属性</strong><strong>：</strong></p> 
        <table class="tb-2"> 
          <thead> 
            <tr> 
              <th>商品名称</th> 
              <th>换货数量</th> 
              <th>商品欲更换属性</th> 
            </tr> 
          </thead> 
          <tbody> 
          <c-rt:forEach items="${serviceOrderProducts}" var="sop">
          	<c-rt:if test="${sop.prodTp!='6'}">
          	<c-rt:forEach items="${sop.serviceOrderDetail }" var="sod">
          	<tr>
            <td class="boder-w"><p>${sod.prodName }</p> 
            
            
            
                    	<c-rt:forEach items="${order.orderProduct }" var="op" varStatus="opStatus">
                    	<c-rt:if test="${op.prodSpecId==sod.orgProdSpecId}">
                <c-rt:forEach items="${op.applyCampaigns}" var="ac" varStatus="status2">
	          	
	          	<p>
	          	<c-rt:if test="${ac.active}">
	          		<span class="type-4">优惠</span>
	          	</c-rt:if>
	          	<c-rt:if test="${!ac.active}">
	          		<span class="type-6">优惠</span>（不符合）
	          	</c-rt:if>
	          	


	          	
	          	${pu:reqSet('pc', pu:get('com.yaodian100.ec.campaign.entity.Campaign', ac.campaignUuid)) }
	          	
	          <a href="javascript:openCampaign_${opStatus.index }_${status2.index }()">${pc.campaignName } </a>
	          
				<script>
				<c-rt:set scope="request" var="campaignDetail">
            	${pu:replaceAll(pc.campaignDetail, '\'', '&#39;')}
            	</c-rt:set>
            	<c-rt:set scope="request" var="campaignDesc">
            	${pu:replaceAll(pc.campaignDesc, '\'', '&#39;')}
            	</c-rt:set>
					function openCampaign_${opStatus.index }_${status2.index }(){
						var dialogId='dialog';
						<%
						String campaignDetail=(String)request.getAttribute("campaignDetail");
						String campaignDesc=(String)request.getAttribute("campaignDesc");
						campaignDetail=campaignDetail.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
						campaignDesc=campaignDesc.replaceAll("\r\n", "").replaceAll("\r", "").replaceAll("\n", "");
						request.setAttribute("campaignDetail", campaignDetail);
						request.setAttribute("campaignDesc", campaignDesc);
						%>
						title='活动信息';
						campaignTitle='${pu:replaceAll(pc.campaignName, '\'', '&#39;')}';
						desc= '${campaignDesc}';
						detail='${campaignDetail}';
						startDate= '<fmt-rt:formatDate value="${pc.startDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
						endDate= '<fmt-rt:formatDate value="${pc.endDateTime}" pattern="yyyy/MM/dd HH:mm:ss"/>';
						url= '${pc.campaignUrl}';
						width= 300;
						height= 'auto';

						var content=compositeCampaign(campaignTitle, desc, detail, startDate, endDate, url);
						openDialog(title, content,width,height);
						$( '#'+dialogId).dialog('option', 'position', 'top' );
					}
				</script>



	          	</p>
	          	</c-rt:forEach>
	          	</c-rt:if>
	          	</c-rt:forEach>
            
            
                </td> 
              <td class="boder-w"><p>${sod.qty }</p>
				</td> 
              <td class="boder-w"><p>${sod.orgProdSpecName}→${sod.prodSpecName }</p>
                </td> 
            </tr> 
            </c-rt:forEach>
            </c-rt:if>
            
            <c-rt:if test="${sop.prodTp=='6'}">
            <tr>
            <td class="boder-w"><p>${sop.prodName }</p> 
                <ul class="t-align-L"> 
                <c-rt:forEach items="${serviceOrderProducts[0].serviceOrderDetail}" var="productDetail">
				 <li>• ${productDetail.prodName }</li> 
				</c-rt:forEach>
                </ul></td> 
              <td class="boder-w"><p>&nbsp;&nbsp;</p>
				<ul> 
				<c-rt:forEach items="${serviceOrderProducts[0].serviceOrderDetail}" var="productDetail">
 				 <li>1</li> 
 				 </c-rt:forEach>
                </ul></td> 
              <td class="boder-w"><p>&nbsp;&nbsp;</p>
                <ul> 
                <c-rt:forEach items="${serviceOrderProducts[0].serviceOrderDetail}" var="productDetail">
  <li>${productDetail.orgProdSpecName}→${productDetail.prodSpecName }</li> 
                </c-rt:forEach>
                </ul></td> 
            </tr> 
            </c-rt:if>
            </c-rt:forEach>
          </tbody> 
        </table> 
                <ul class="li-note"> 
          <li>‧如果成套商品中有部分商品存在质量问题，在办理换货时，亦必须提供成套商品。</li> 
          <li>‧同一商品仅有一次退换货机会，请慎选您所要換货的数量。<span class="txt-gy">（例：同一商品购买5件，退2件后，剩餘3件将无法再申请退、换货。）</span></li> 
        </ul> 
        
        
        <ul> 
          <li class="w-1of1"><strong>换货原因：</strong>${serviceOrder.reason }</li> 
          <li class="w-1of1 return-txt"><strong>换货问题描述：</strong>${serviceOrder.description }</li> 
          <li class="w-1of1 return-txt"><strong>配件贈品狀態：</strong>${serviceOrder.accessaryDescription }</li> 
        </ul> 
      </div> 
      <!-- 換货資訊 --> 
      <!-- 取货資訊 --> 
      <a name="receiverInfo"></a>
      <h3>取货信息<c-rt:if test="${order.receiverTp=='30'}">
      <span>换货商品将送至您原本指定的门店</span>
      </c-rt:if>
      <c-rt:if test="${order.receiverTp!='30'}">
      <span>为加速您的退换货作业，以下所有栏位均为必填</span>
      </c-rt:if></h3> 
      <div class="d-show"> 
        <ul> 
          <li class="w-1of1"><strong>收货人姓名：</strong>${serviceOrder.receiverName }</li> 
          <li class="w-1of2"><strong>手机号码：</strong>${serviceOrder.receiverMobile }</li> 
          <li class="w-1of2"><strong>固定電話：</strong>
          <c-rt:if test="${serviceOrder.receiverPhone!='null' && serviceOrder.receiverPhone!=' ' && !empty serviceOrder.receiverPhone}">
          ${(!empty serviceOrder.receiverPhoneArea && serviceOrder.receiverPhoneArea!=' ' && serviceOrder.receiverPhoneArea!='null')?serviceOrder.receiverPhoneArea:'' }-${serviceOrder.receiverPhone} 分机：${(serviceOrder.receiverExt!='null' && serviceOrder.receiverExt!=' ' && !empty serviceOrder.receiverExt)?serviceOrder.receiverExt:'' }
          </c-rt:if>
           </li> 
          <li class="w-1of1"> 
          	<div><strong>收货人地址：</strong></div> 
            <div>${serviceOrder.receiverProvince }，${serviceOrder.receiverCity }，${serviceOrder.receiverArea }，${serviceOrder.receiverAddr }，${serviceOrder.receiverZip } </div> 
          </li> 
        </ul> 
      </div> 
      <!-- 取货資訊 --> 
      <p align="center"><br /><a href="<c-rt:url value="/member/serviceOrder/changeProductPrint.do?serviceOrderId=${serviceOrder.serviceId }"/>" class="btn-mid-8">打印本换货明细</a></p> 
    <!-- 注意事项 --> 
    <div class="txt-note"> 
      <p><strong>注意事项：</strong></p> 
      <ul> 
        <li>1. 换货商品审核无误以后，耀点100将在<span class="txt-rd">3个工作天</span>内把新品寄出给您。</li> 
        <li>2. 对于换货方式有任何疑问，请先参考<a href="#">换货流程说明</a>，或<a href="<c-rt:url value="/member/cs/page.do?page=request&orderId=${serviceOrder.orderId }&productId=${serviceOrderProducts[0].prodId }"/>">联络客服</a>。</li> 
      </ul> 
    </div> 
    <!-- 注意事项 --> 
   <!-- 我的訂單 --> 

</div>
<div id="dialog" style="display:none">
  <p>
  		<c-rt:if test="${serviceOrder.orderSt=='10'}">
  		<strong>换货申请中，请于收到商品后15天內将换货商品寄出。</strong>
   		</c-rt:if>
   		<c-rt:if test="${serviceOrder.orderSt=='20'}">
        <strong>换货商品已发货。</strong>
        </c-rt:if>   
        <c-rt:if test="${serviceOrder.orderSt=='30' }">
        <strong>换货商品不符合换货标准，等待客服人员联系。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='40'}">
        <strong>换货转退货成功，已完成退款。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='50'}">
        <strong>换货商品未于期限内寄出，换货申请失败。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='60'}">
        <strong>换货商品未于期限内寄出，换货申请失败，商品已退回。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='70'}">
        <strong>换货商品不符合换货标准，无法进行换货。</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='80'}">
        <strong>您已于<fmt-rt:formatDate value="${serviceOrder.modifyDate}" pattern="yyyy-MM-dd HH:mm"/>取消换货</strong>
        </c-rt:if>
        <c-rt:if test="${serviceOrder.orderSt=='90'}">
        <strong>换货商品已送达，换货完成。</strong>
        </c-rt:if>
  </p> 
 		 <div style="text-align:center;"><a href="javascript:closeDialog()" class="btn-mid">确定</a></div> 
</c-rt:if>
<c-rt:if test="${serviceOrder.memberId!=mu:memberId()}">
您无权查阅本服务单！
</c-rt:if>
  </div>
<!-- content end -->
